﻿<customWindow:CustomWindowStyle
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:julmar="http://www.julmar.com/wpfhelpers"
    xmlns:customWindow="clr-namespace:MediaBrowser.CustomWindow;assembly=MediaBrowser.CustomWindow"
    xmlns:ViewModel="clr-namespace:MediaBrowser.Gui.ViewModels"
    xmlns:View="clr-namespace:MediaBrowser.Gui.Views"
    xmlns:MediaBrowser_Controls="clr-namespace:MediaBrowser.CustomControls;assembly=MediaBrowser.CustomControls"	
    xmlns:MouseCursors="clr-namespace:MediaBrowser.CustomControls.MouseCursors;assembly=MediaBrowser.CustomControls"
    xmlns:CustomControls_Transitions="clr-namespace:MediaBrowser.CustomControls.Transitionals;assembly=MediaBrowser.CustomControls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	x:Class="MediaBrowser.Gui.WindowMain"
    Icon="/Images/Icons/mediaBrowser.ico"
    Title="Media Browser" Height="768" Width="1024" mc:Ignorable="d" HiddenMaximizeBox="False" HiddenMinimumBox="False"
    d:DesignWidth="768" d:DesignHeight="1024"
    ResizeMode="CanResizeWithGrip"
    MouseCursors:CursorSet.Cursor="Arrow"
    >

    <Window.DataContext>
        <Binding Mode="OneWay" Path="Main" Source="{StaticResource Locator}"/>
    </Window.DataContext>

    <customWindow:CustomWindowStyle.Resources>

        <ViewModel:ViewModelLocator x:Key="Locator" d:IsDataSource="True"/>

        <DataTemplate DataType="{x:Type ViewModel:PageHomeViewModel}">
            <ContentPresenter Content="{Binding Source={StaticResource PageHomeView}}"/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type ViewModel:PageMoviesViewModel}">
            <ContentPresenter Content="{Binding Source={StaticResource PageMoviesView}}"/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type ViewModel:PageMusicViewModel}">
            <ContentPresenter Content="{Binding Source={StaticResource PageMusicView}}"/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type ViewModel:PagePicturesViewModel}">
            <ContentPresenter Content="{Binding Source={StaticResource PagePicturesView}}"/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type ViewModel:PageBooksViewModel}">
            <ContentPresenter Content="{Binding Source={StaticResource PageBooksView}}"/>
        </DataTemplate>

        <Storyboard x:Key="AnimTitle">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="label" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="AnimPnlGrp">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.00" Storyboard.TargetName="TransitionBox" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.5"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

    </customWindow:CustomWindowStyle.Resources>


    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource AnimTitle}"/>
            <BeginStoryboard Storyboard="{StaticResource AnimPnlGrp}"/>
        </EventTrigger>
    </Window.Triggers>

    <Grid x:Name="GridMain">
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#FF12475D" Offset="0.014"/>
                <GradientStop Color="Black" Offset="1"/>
                <GradientStop Color="#FE28799F" Offset="0.512"/>
                <GradientStop Color="#FE174E66" Offset="0.573"/>
                <GradientStop Color="#FE16333F" Offset="0.293"/>
                <GradientStop Color="#FE0F1B20" Offset="0.78"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="60"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="45"/>
        </Grid.RowDefinitions>

        <StackPanel Orientation="Vertical" Grid.Row="0">
            <Label x:Name="label" Content="Media Browser"  FontFamily="Calibri" FontSize="32" Background="{x:Null}" FontWeight="Bold"
				   Margin="10,0,0,0">
                <Label.Effect>
                    <DropShadowEffect/>
                </Label.Effect>
                <Label.Foreground>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF1B2326" Offset="0"/>
                        <GradientStop Color="#FF629FB9" Offset="1"/>
                        <GradientStop Color="#FFD8DFE2" Offset="0.488"/>
                    </LinearGradientBrush>
                </Label.Foreground>
            </Label>
            <!--<Rectangle Height="21" Width="209" HorizontalAlignment="Left" Margin="9.703,0,0,0" RenderTransformOrigin="0.5,0.5">
				<Rectangle.OpacityMask>
					<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
	                    <GradientStop Color="#19636668" Offset="0.476"/>
	                    <GradientStop Offset="1" Color="#CC175178"></GradientStop>
                	</LinearGradientBrush>
				</Rectangle.OpacityMask>
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleY="-1"/>
						<SkewTransform AngleX="-8.882"/>
						<RotateTransform/>
						<TranslateTransform X="-1.343"/>
					</TransformGroup>
				</Rectangle.RenderTransform>
				<Rectangle.Fill>
					 <VisualBrush Visual="{Binding ElementName=label}">
                	 </VisualBrush>
				</Rectangle.Fill>
			</Rectangle>-->
        </StackPanel>

        <CustomControls_Transitions:TranslateTransitionElement x:Name="TransitionBox" Grid.Row="1" 
                                                               ContentTransition="{Binding CurrentContent}"
                                                               IsGoForward="{Binding IsGoForwardView}"
                                                               Visibility="Visible"
                                                               Margin="30,6,30,6">
        </CustomControls_Transitions:TranslateTransitionElement>

        <Border Grid.Row="2" Background="{DynamicResource DefaultedBorderBrush}" CornerRadius="2" 
                Margin="0" Padding="0,2">
            <Grid Margin="0">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0">

                    <MediaBrowser_Controls:ImageButton 				
        				Margin="3,3,30,3"
        				Source="Images\backward.png" Command="{Binding BackwardViewCommand}"/>

                    <MediaBrowser_Controls:ImageButton 				
        				Margin="3,3,30,3"
        				Source="Images\Home.png" Command="{Binding HomeViewCommand}"/>

                    <MediaBrowser_Controls:ImageButton 				
        				Margin="3,3,0,3"
        				Source="Images\Forward.png" Command="{Binding ForwardViewCommand}"/>

                </StackPanel>
                <Button Command="{Binding AboutCommand}" MouseCursors:CursorSet.Cursor="Hand" 
                        HorizontalAlignment="Right" Margin="0,0,15,0" Style="{DynamicResource ButtonStyleNav2}" 
                        Width="34" Height="24" Content="?" BorderThickness="0" ToolTip="A propos"/>
            </Grid>
        </Border>
    </Grid>
</customWindow:CustomWindowStyle>
